package edu.yctc.weblog.constant;

/**
 * 
 * @className ResultCode
 * @description 业务消息及业务码
 * @author zyj
 * @date 2020年6月15日
 *
 */
public class ResultCode {

    /** 成功 */
    public static final int SUCCESS = 1;
    public static final String MSG_SUCCESS = "success";

    // 业务中细分的code 1000-1999
    /** 账号或密码错误 */
    public static final int ERROR_ACCOUNT_OR_PASSWORD = 1000;
    public static final String MSG_ERROR_ACCOUNT_OR_PASSWORD = "error account or password";

    public static final int ADMIN_NOT_SIGN_IN = 1001;
    public static final String MSG_ADMIN_NOT_SIGN_IN = "admin does not sign in";

    public static final int ADMIN_NOT_EXIST = 1002;
    public static final String MSG_ADMIN_NOT_EXIST = "admin does not exist";

    public static final int ADMIN_ORIGINAL_PASSWORD_NOT_MATCH = 1003;
    public static final String MSG_ADMIN_ORIGINAL_PASSWORD_NOT_MATCH = "original password does not match";

    public static final int CATEGORY_CATEGORY_ALREADY_EXIST = 1004;
    public static final String MSG_CATEGORY_CATEGORY_ALREADY_EXIST = "category already exist";

    public static final int TAG_HAS_RELATION_WITH_BLOG = 1005;
    public static final String MSG_TAG_HAS_RELATION_WITH_BLOG = "tag has relation with blog";

    // 一些可能共性的异常code 9000~9999
    /** 数据库错误 */
    public static final int DB_ERROR = 9000;
    public static final String MSG_DB_ERROR = "db error";

    /** 参数非法 */
    public static final int PARAMETER_INVALID = 9001;
    public static final String MSG_PARAMETER_INVALID = "parameter invalid";

    /** 请求非法 */
    public static final int REQUEST_INVALID = 9002;
    public static final String MSG_REQUEST_INVALID = "request invalid";

    /** 系统错误 */
    public static final int ERROR_SYSTEM_EXCEPTION = 9999;
    public static final String MSG_ERROR_SYSTEM_EXCEPTION = "system error";

    // 保存文章入参过筛不合格返回msg
    public static final String TITLE_UNINPUT = "uninput title";
    public static final String TITLE_OVER_SIZE = "title over size";
    public static final String TAG_UNINPUT = "uninput tag";
    public static final String TAG_OVER_SIZE = "tag over size";
    public static final String PATH_OVER_SIZE = "path over size";
    public static final String CONTENT_UNINPUT = "uninput content";
    public static final String CONTENT_OVERSIZE = "content over size";
    public static final String COVER_EMPTY = "empty cover image";

    // 评论入参过筛不合格返回msg
    public static final String EMPTY_VERIFY_CODE = "empty verify code";
    public static final String ERROR_VERIFY_CODE = "error verify code";
    public static final String EMPTY_COMMENTATOR = "empty commentator";
    public static final String EMPTY_EMAIL = "empty email";
    public static final String INVALID_EMAIL = "invalid email";
    public static final String EMPTY_COMMENT = "empty comment";
    public static final String COMMENT_OVER_SIZE = "comment over size";

}
